import { ResPage, ExamTestSelf } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 我的考试模块
 */
// 获取考试列表
export const getExamSelfList = (params: ExamTestSelf.ReqExamTestSelfParams) => {
  return http.post<ResPage<ExamTestSelf.ResExamTestSelfList>>(`/exam/test/self/query`, params);
};
// 获取考试详情
export const getExamSelfDtl = (params: { testId: number }) => {
  return http.post<ExamTestSelf.ResTestInfo>(`/exam/test/self/detail`, params);
};
// 获取试卷详情
export const getTestInfo = (params: { testId: number }) => {
  return http.post<ExamTestSelf.ResTestInfo>(`/exam/test/self/start`, params);
};
// 获取考试列表
export const submitTest = (params: ExamTestSelf.ReqTestSubmitParams) => {
  return http.post<ExamTestSelf.ResTestInfo>(`/exam/test/self/submit`, params);
};

// 获取考试列表
export const modifyAnswer = (params: ExamTestSelf.ReqTestSubmitParams) => {
  return http.post<ExamTestSelf.ResTestInfo>(`/exam/test/self/modify`, params);
};
